home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / java / applet / Applet.class (.txt) next >
Encoding:
Java Class File  |  2006-11-29  |  3.3 KB  |  163 lines

  1. package java.applet;
  2.  
  3. import java.awt.AWTPermission;
  4. import java.awt.Dimension;
  5. import java.awt.GraphicsEnvironment;
  6. import java.awt.HeadlessException;
  7. import java.awt.Image;
  8. import java.awt.Panel;
  9. import java.io.IOException;
  10. import java.io.ObjectInputStream;
  11. import java.net.MalformedURLException;
  12. import java.net.URL;
  13. import java.util.Locale;
  14. import javax.accessibility.AccessibleContext;
  15. import sun.applet.AppletAudioClip;
  16.  
  17. public class Applet extends Panel {
  18.    private transient AppletStub stub;
  19.    private static final long serialVersionUID = -5836846270535785031L;
  20.    AccessibleContext accessibleContext = null;
  21.  
  22.    public Applet() throws HeadlessException {
  23.       if (GraphicsEnvironment.isHeadless()) {
  24.          throw new HeadlessException();
  25.       }
  26.    }
  27.  
  28.    private void readObject(ObjectInputStream var1) throws ClassNotFoundException, IOException, HeadlessException {
  29.       if (GraphicsEnvironment.isHeadless()) {
  30.          throw new HeadlessException();
  31.       } else {
  32.          var1.defaultReadObject();
  33.       }
  34.    }
  35.  
  36.    public final void setStub(AppletStub var1) {
  37.       if (this.stub != null) {
  38.          SecurityManager var2 = System.getSecurityManager();
  39.          if (var2 != null) {
  40.             var2.checkPermission(new AWTPermission("setAppletStub"));
  41.          }
  42.       }
  43.  
  44.       this.stub = var1;
  45.    }
  46.  
  47.    public boolean isActive() {
  48.       return this.stub != null ? this.stub.isActive() : false;
  49.    }
  50.  
  51.    public URL getDocumentBase() {
  52.       return this.stub.getDocumentBase();
  53.    }
  54.  
  55.    public URL getCodeBase() {
  56.       return this.stub.getCodeBase();
  57.    }
  58.  
  59.    public String getParameter(String var1) {
  60.       return this.stub.getParameter(var1);
  61.    }
  62.  
  63.    public AppletContext getAppletContext() {
  64.       return this.stub.getAppletContext();
  65.    }
  66.  
  67.    public void resize(int var1, int var2) {
  68.       Dimension var3 = this.size();
  69.       if (var3.width != var1 || var3.height != var2) {
  70.          super.resize(var1, var2);
  71.          if (this.stub != null) {
  72.             this.stub.appletResize(var1, var2);
  73.          }
  74.       }
  75.  
  76.    }
  77.  
  78.    public void resize(Dimension var1) {
  79.       this.resize(var1.width, var1.height);
  80.    }
  81.  
  82.    public void showStatus(String var1) {
  83.       this.getAppletContext().showStatus(var1);
  84.    }
  85.  
  86.    public Image getImage(URL var1) {
  87.       return this.getAppletContext().getImage(var1);
  88.    }
  89.  
  90.    public Image getImage(URL var1, String var2) {
  91.       try {
  92.          return this.getImage(new URL(var1, var2));
  93.       } catch (MalformedURLException var4) {
  94.          return null;
  95.       }
  96.    }
  97.  
  98.    public static final AudioClip newAudioClip(URL var0) {
  99.       return new AppletAudioClip(var0);
  100.    }
  101.  
  102.    public AudioClip getAudioClip(URL var1) {
  103.       return this.getAppletContext().getAudioClip(var1);
  104.    }
  105.  
  106.    public AudioClip getAudioClip(URL var1, String var2) {
  107.       try {
  108.          return this.getAudioClip(new URL(var1, var2));
  109.       } catch (MalformedURLException var4) {
  110.          return null;
  111.       }
  112.    }
  113.  
  114.    public String getAppletInfo() {
  115.       return null;
  116.    }
  117.  
  118.    public Locale getLocale() {
  119.       Locale var1 = super.getLocale();
  120.       return var1 == null ? Locale.getDefault() : var1;
  121.    }
  122.  
  123.    public String[][] getParameterInfo() {
  124.       return (String[][])null;
  125.    }
  126.  
  127.    public void play(URL var1) {
  128.       AudioClip var2 = this.getAudioClip(var1);
  129.       if (var2 != null) {
  130.          var2.play();
  131.       }
  132.  
  133.    }
  134.  
  135.    public void play(URL var1, String var2) {
  136.       AudioClip var3 = this.getAudioClip(var1, var2);
  137.       if (var3 != null) {
  138.          var3.play();
  139.       }
  140.  
  141.    }
  142.  
  143.    public void init() {
  144.    }
  145.  
  146.    public void start() {
  147.    }
  148.  
  149.    public void stop() {
  150.    }
  151.  
  152.    public void destroy() {
  153.    }
  154.  
  155.    public AccessibleContext getAccessibleContext() {
  156.       if (this.accessibleContext == null) {
  157.          this.accessibleContext = new AccessibleApplet(this);
  158.       }
  159.  
  160.       return this.accessibleContext;
  161.    }
  162. }
  163.